/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module util.c - Header file for the Various application utility functions |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/util.h $ 
**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef VSUTIL_H
#define VSUTIL_H

#include <stdio.h>
#include <math.h>
#include <stdarg.h>
#include <define.h>

#define SAFE_LIMIT     ((long) SIZE_BATCH_REC)

#define VSAbort(inErrCode)  vdVSAbortProc(inErrCode)

#define lnMaxValue(x) (long)(pow(10.0, (double)x) - 1)

void vdVSAbortProc (int inErrCode);
VS_BOOL fMemAvail (long *plnAvailSz);
char *strlcpy (char *szString1, char *szString2, int count);
char *strupr (char *szString);
int inChoiceStrNoCpy(char *pchDest, char *pchSrc, int inMax);
void vdStrNoCpy(char *pchDest, char *pchSrc, int  inMax);
void vdStrNoCpyChar(char *pchDest, char *pchSrc, int  inMax);
int inStrPos(char *pchDest, char chSrc, int  inMax);
int	get_env_int ( const char * tag );
void put_env_int ( char * tag, int value );
char *pchGetMessage(long lnMessageIndex);

#define ML_RIGHT            1
#define ML_LEFT             2
#define ML_SPACE            0x20
#define ML_NULL             0x00
#define ML_2B_MAX_MSG_SIZE  16

extern void vdMlPadChar(char *, char *, int, int, char);
int		inMLstrlen ( char *szBuf );

#endif

